<template>
    <!-- 设计策划情况-->
    <div class="schemeApproval">
      <title-name title="设计策划情况" style="margin-top: 50px"></title-name>
      <a-spin :spinning="loading">
        <div class="table-div">
          <a-table :columns="columns" bordered :pagination="false" :data-source="dataTable"> </a-table>
        </div>
      </a-spin>
    </div>
  </template>
  <script>
  import {queryMonthDesignPlanListByBaseId} from '@/api/design/monthlyReport/monthlyWorkReport'
  export default {
    name: 'a' + Date.now(),
    props: {
      id: {
        type: String,
        default() {
          return ''
        }
      },
    },
    data() {
      this.columns = [
        {
         title: '序号',width: '80px',
         customRender(text, record, index) {
         return index + 1
        }
       },
        { title: '分公司', dataIndex: 'branchCompany', align: 'center',},
        { title: '项目名称', dataIndex: 'projectName', align: 'center'},
        { title: '中标日期', dataIndex: 'winningDate', align: 'center',},
        { title: '是否上报策划书', dataIndex: 'haveDesignBook', align: 'center',},
        { title: '评审状态', dataIndex: 'auditStatusName', align: 'center',
         customRender(text, record, index) {
          return  text?text:'';
          }}
      ]
      return {
        loading: false,
        dataTable:[]
      }
    },
    watch:{
      id: {
        handler(val) {
          this.queryMonthDesignPlanListByBaseIdFn(val);
        },
        immediate: true
      },
    },
    methods: {
        queryMonthDesignPlanListByBaseIdFn(id){
        this.loading = true;
        queryMonthDesignPlanListByBaseId({id:id}).then((res)=>{
          if(res.code == '200'){
            this.loading = false;
            this.dataTable = res.data;
          }
        }).catch(() => {
            this.loading = false
            this.$message.warning(err.data.message)
          })
      }
    },
    mounted() {}
  }
  </script>
  <style lang="less" scoped>
  ::v-deep.titleName{
   margin-top:10px!important;
 }

</style>
      